<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Electron Button Demo</title>
    <style>
        body {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            margin: 0;
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
        }
        
        button {
            padding: 15px 30px;
            font-size: 18px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        
        button:hover {
            background-color: #45a049;
        }
        
        #message {
            margin-top: 20px;
            font-size: 20px;
            color: #333;
            min-height: 30px;
        }
    </style>
</head>
<body>
    <button id="actionBtn">点击我</button>
    <div id="message"></div>

    <script>
        const { ipcRenderer } = require('electron')
        const actionBtn = document.getElementById('actionBtn')
        const messageDiv = document.getElementById('message')
        
        actionBtn.addEventListener('click', () => {
            // 显示消息
            messageDiv.textContent = '用户点击了按钮'
            
            // 请求主进程打开开发者工具
            ipcRenderer.send('open-devtools')
        })
    </script>
</body>
</html>